package cn.gson.school.entity.jiuye;

import java.sql.Timestamp;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonFormat;

import cn.gson.school.entity.xitong.ImageEntity;

/**
 * 邮件表（offer）
 * 
 * @author 华少
 *
 */

@Entity
@Table(name = "tb_jy_offer")
public class OfferEntity {
	/**
	 * offer_id 邮件编号 interview_id 面试记录编号 offer_printscreen 邮件截图 offer_time 邮件发送时间
	 * upload_time 上传时间
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "offer_id")
	private Long offerId;

	@OneToOne
	@JoinColumn(name = "interview_id")
	private InterviewRecordEntity interviewId;

	@OneToOne
	@JoinColumn(name = "touxiang")
	private ImageEntity touXiang;

	@Column(name = "offer_time")
	@JsonFormat(pattern = "yyyy-MM-ddHH:mm:ss")
	private Date offerTime;

	@Column(name = "upload_time")
	@JsonFormat(pattern = "yyyy-MM-ddHH:mm:ss")
	private Date uploadTime;

	@OneToOne(mappedBy = "offerId")
	private FileEntity fileEntity;

	
	public Long getOfferId() {
		return offerId;
	}

	public void setOfferId(Long offerId) {
		this.offerId = offerId;
	}

	public InterviewRecordEntity getInterviewId() {
		return interviewId;
	}

	public void setInterviewId(InterviewRecordEntity interviewId) {
		this.interviewId = interviewId;
	}

	public Date getOfferTime() {
		return offerTime;
	}

	public void setOfferTime(Date offerTime) {
		this.offerTime = offerTime;
	}

	public Date getUploadTime() {
		return uploadTime;
	}

	public void setUploadTime(Date uploadTime) {
		this.uploadTime = uploadTime;
	}

	public FileEntity getFileEntity() {
		return fileEntity;
	}

	public void setFileEntity(FileEntity fileEntity) {
		this.fileEntity = fileEntity;
	}

	public ImageEntity getTouXiang() {
		return touXiang;
	}

	public void setTouXiang(ImageEntity touXiang) {
		this.touXiang = touXiang;
	}

	@Override
	public String toString() {
		return "OfferEntity [offerId=" + offerId + ", interviewId=" + interviewId + ", touXiang=" + touXiang
				+ ", offerTime=" + offerTime + ", uploadTime=" + uploadTime + ", fileEntity=" + fileEntity + "]";
	}

}
